package com.ruoyi.project.mahjong.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mahjong.mapper.TParagraphMapper;
import com.ruoyi.project.mahjong.domain.TParagraph;
import com.ruoyi.project.mahjong.service.ITParagraphService;

/**
 * 时间段收费Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-07
 */
@Service
public class TParagraphServiceImpl implements ITParagraphService 
{
    @Autowired
    private TParagraphMapper tParagraphMapper;

    /**
     * 查询时间段收费
     * 
     * @param id 时间段收费ID
     * @return 时间段收费
     */
    @Override
    public TParagraph selectTParagraphById(Long id)
    {
        return tParagraphMapper.selectTParagraphById(id);
    }

    /**
     * 查询时间段收费列表
     * 
     * @param tParagraph 时间段收费
     * @return 时间段收费
     */
    @Override
    public List<TParagraph> selectTParagraphList(TParagraph tParagraph)
    {
        return tParagraphMapper.selectTParagraphList(tParagraph);
    }

    /**
     * 新增时间段收费
     * 
     * @param tParagraph 时间段收费
     * @return 结果
     */
    @Override
    public int insertTParagraph(TParagraph tParagraph)
    {
        tParagraph.setCreateTime(DateUtils.getNowDate());
        return tParagraphMapper.insertTParagraph(tParagraph);
    }

    /**
     * 修改时间段收费
     * 
     * @param tParagraph 时间段收费
     * @return 结果
     */
    @Override
    public int updateTParagraph(TParagraph tParagraph)
    {
        tParagraph.setUpdateTime(DateUtils.getNowDate());
        return tParagraphMapper.updateTParagraph(tParagraph);
    }

    /**
     * 批量删除时间段收费
     * 
     * @param ids 需要删除的时间段收费ID
     * @return 结果
     */
    @Override
    public int deleteTParagraphByIds(Long[] ids)
    {
        return tParagraphMapper.deleteTParagraphByIds(ids);
    }

    /**
     * 删除时间段收费信息
     * 
     * @param id 时间段收费ID
     * @return 结果
     */
    @Override
    public int deleteTParagraphById(Long id)
    {
        return tParagraphMapper.deleteTParagraphById(id);
    }
}
